USE [GD1C2012]
GO

/****** Object:  UserDefinedFunction [SUPERACIDOS].[PermisoHabilitado]    Script Date: 06/03/2012 19:02:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [SUPERACIDOS].[FuncionalidadHabilitada]
(
	-- Add the parameters for the function here
	@rol INT , @funcionalidad int
)
RETURNS BIT
AS
BEGIN
	-- Declare the return variable here
	IF EXISTS (SELECT 1 FROM SUPERACIDOS.Rol_Funcionalidad WHERE RoFu_RolId = @rol AND RoFu_FuncionalidadId = @funcionalidad)
		RETURN 1
	
	
	RETURN 0
END

GO


